package com.imelite.qyh.action;

import com.imelite.qyh.base.result.ResultBeanFactory;
import com.imelite.qyh.model.Yycpbg;
import com.imelite.qyh.service.YycpbgService;
import com.imelite.qyh.util.BaseResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class YycpbgAction {
    @Autowired
    private YycpbgService yycpbgService;
    @RequestMapping("/com/imelite/qyh/YycpbgAction/insert")
    public void insert(HttpServletRequest request, HttpServletResponse response,String idlist,String yyxxid){
        Yycpbg yycpbg=new Yycpbg();
        yycpbg.setCpda(idlist);
        yycpbg.setYyxxid(yyxxid);
        yycpbgService.insertSelective(yycpbg);
        BaseResponseUtil.responseAjaxJson(response, ResultBeanFactory.getResultBeanSuccess());
    }

    @RequestMapping("/com/imelite/qyh/YycpbgAction/update")
    public void update(HttpServletRequest request, HttpServletResponse response,Yycpbg yycpbg){
        yycpbgService.updateByPrimaryKeySelective(yycpbg);
        BaseResponseUtil.responseAjaxJson(response, ResultBeanFactory.getResultBeanSuccess());
    }
}
